<?php
 
require '../system/common.php';
require '../app/Lib/common.php';
require './lib/functions.php';
if (isset($_REQUEST['i_type']))
{
$i_type = intval($_REQUEST['i_type']);
}
if ($i_type == 1)
{
$request = $_REQUEST;
}
else
{
if (isset($_REQUEST['requestData']))
{
if ($i_type == 2)
{
$request = json_decode(trim($_REQUEST['requestData']),1);
}else
{
$request = base64_decode((trim($_REQUEST['requestData'])));
$request = json_decode($request,1);
}
}else
{
$request = $_REQUEST;
}
}
$m_config = getMConfig();
define('VERSION',1);
define('CACHE_TIME',60);
if (intval($m_config['page_size']) == 0){
define('PAGE_SIZE',20);
}else{
define('PAGE_SIZE',intval($m_config['page_size']));
}
$class = strtolower(strim($request['act']));
$act2 = strtolower(strim($request['act_2']))?strtolower(strim($request['act_2'])):'';
define('ACT',$class);
define('ACT_2',$act2);
if(1==1) 
{
$url = get_domain().APP_ROOT.'/index.php?requestData='.$_REQUEST['requestData'].'&r_type=2';
$api_log = array();
$api_log['api'] = $url;
$api_log['act'] = $class;
$GLOBALS['db']->autoExecute(DB_PREFIX.'api_log',$api_log,'INSERT');
}
if(file_exists('./lib/'.$class.'.action.php'))
{
require_once './lib/'.$class.'.action.php';
if(class_exists($class))
{
$obj = new $class;
if(method_exists($obj,'index'))
{
$obj->index();
}
else
{
header('Content-Type:text/html; charset=utf-8');
exit('Hack attemp!');
}
}
else
{
header('Content-Type:text/html; charset=utf-8');
exit('Hack attemp!');
}
}
else
{
header('Content-Type:text/html; charset=utf-8');
exit('Hack attemp!'.ACT);
}

?>